package com.jellyfishumbrella.GL;

public class Keyframe implements Comparable, Cloneable {
	public Vector3d	pos, rot, scale;
	public long		time;		// in milliseconds

	public Keyframe() {
		clear();
		scale = new Vector3d(1.0,1.0,1.0);
	}

	public Keyframe(long time) {
		this.time = time;
		clear();
	}

	public void clear() {
		pos = new Vector3d();
		rot = new Vector3d();
		scale = new Vector3d(1.0,1.0,1.0);
	}

	public Keyframe clone() {
		Keyframe newKeyframe = new Keyframe();
		newKeyframe.time = time;
		newKeyframe.pos = pos.clone();
		newKeyframe.rot = rot.clone();
		newKeyframe.scale = scale.clone();

		return newKeyframe;
	}

	@Override
	public int compareTo(Object o) {
		long A = time - ((Keyframe) o).time;
		if (A == 0) {
			return 0;
		} else {
			long B = Math.abs(A) / A;
			int C = (int) B;
			return C;
		}
	}
}
